/************************************************************************/
/*Copyright (c) James Zhao 2007,2008
/*This file is part of AdminOverlay.
/*AdminOverlay is free software: you can redistribute it and/or modify
/*it under the terms of the GNU General Public License as published by
/*the Free Software Foundation, either version 3 of the License, or
/*(at your option) any later version.
/*
/*AdminOverlay is distributed in the hope that it will be useful,
/*but WITHOUT ANY WARRANTY; without even the implied warranty of
/*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/*GNU General Public License for more details.
/*
/*You should have received a copy of the GNU General Public License
/*along with AdminOverlay.  If not, see <http://www.gnu.org/licenses/>.                                                                     */
/*************************************************************************/
#pragma once

class GraphicsAdapter;
class InputManager;
#include "d3dx9core.h"
#include "CEGUI.h"
#include "CEGUIDefaultResourceProvider.h"
#include "RendererModules/directx9GUIRenderer/d3d9renderer.h"
using namespace CEGUI;
class GameOverlay
{
public:
	GameOverlay(void);
	~GameOverlay(void) {}
	//loads the input manager
	void InitalizeImmediateServices(HINSTANCE instance, DWORD threadID);
	//loads everything else
	void InitalizeDelayedServices();
	static GameOverlay *currentInstance;
public:
	InputManager * GetInputManager() const;
	GraphicsAdapter * GetGraphicsAdapter() const;
	DirectX9Renderer *uiRenderer;
	Window *rootWindow;
public:
	bool IsActive() const;
	void IsActive(bool val);
	static void DrawHandler(LPDIRECT3DDEVICE9 device);
	static void PreResetHandler();
	static void PostResetHandler();
	
private:
	bool requireResizeOp;
	InputManager *inputManager;
	GraphicsAdapter *graphicsAdapter;
	void CreateGUI(LPDIRECT3DDEVICE9 device);
private:
	bool isActive; 
};
